home *** CD-ROM | disk | FTP | other *** search
/ Leonardo the Inventor / Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso / LEOWINMV / TIMELINE.DIR / 00013_Script_TIMELINE MOVEMENTS 2 < prev    next >
Text File  |  1996-03-31  |  4KB  |  134 lines

  1. -- -----------------------------------------------------------
  2. -- Handler showTimePeriods shows all the time periods.
  3.  
  4. on showTimePeriods
  5.   global currentTimePeriod, timeLineMenu
  6.   
  7.   puppetSprite timeLineMenu, TRUE
  8.   set the locH of sprite timeLineMenu = the locH of sprite currentTimePeriod
  9.   set the locV of sprite timeLineMenu = the bottom of sprite currentTimePeriod + 10 + (the height of sprite timeLineMenu / 2) 
  10.   updateStage 
  11. end
  12.  
  13. -- -----------------------------------------------------------
  14. -- Handler hideTimePeriods hides the time periods.
  15.  
  16. on hideTimePeriods
  17.   global timeLineMenu
  18.   
  19.   set the locH of sprite timeLineMenu = 1000
  20.   set the locV of sprite timeLineMenu = 1000
  21.   updateStage
  22.   puppetSprite timeLineMenu, FALSE
  23. end
  24.  
  25. -- -----------------------------------------------------------
  26. -- Handler goClickedTimePeriod 
  27.  
  28. on goClickedTimePeriod clickV
  29.   global timeLineMenu
  30.   
  31.   set buttonIndex = getButtonIndexV(clickV, timeLineMenu, 12)
  32.   hideTimePeriods
  33.   
  34.   --  if (buttonIndex = 0) then
  35.   --    go "Overlay"
  36.   if (buttonIndex = 0) then
  37.     go "Canaanite"
  38.   else if (buttonIndex = 1) then
  39.     go "Biblical"
  40.   else if (buttonIndex = 2) then
  41.     go "Persian"
  42.   else if (buttonIndex = 3) then
  43.     go "Hellenistic"
  44.   else if (buttonIndex = 4) then
  45.     go "Roman"
  46.   else if (buttonIndex = 5) then
  47.     go "Byzantine"
  48.   else if (buttonIndex = 6) then
  49.     go "Early Muslim"
  50.   else if (buttonIndex = 7) then
  51.     go "Crusader Kingdom"
  52.   else if (buttonIndex = 8) then
  53.     go "Mamluk"
  54.   else if (buttonIndex = 9) then
  55.     go "Ottoman"
  56.   else if (buttonIndex = 10) then
  57.     go "British Mandate"
  58.   else if (buttonIndex = 11) then
  59.     go "present State"
  60.   end if
  61.   hideTimePeriods
  62. end
  63.  
  64. -- -----------------------------------------------------------
  65. -- Handler getButtonIndexV returns the button index (starting
  66. -- from 0) of the clicked button (on a vertical button bar)
  67.  
  68. on getButtonIndexV clickV, buttonSprite, numButtons
  69.   put the height of sprite buttonSprite into ButtonBarHeight
  70.   put ButtonBarHeight/numButtons into OneButtonHeight
  71.   put the top of sprite buttonSprite into ButtonBarTop
  72.   
  73.   return  (clickV - ButtonBarTop) / OneButtonHeight
  74. end
  75.  
  76. -- -----------------------------------------------------------
  77. -- Handler setOverlayTimePeriodCursors 
  78.  
  79. on setOverlayTimePeriodCursors
  80.   setSpriteCursors [[7,"fingerCursor"], [8,"fingerCursor"], [9,"fingerCursor"], [10,"fingerCursor"], [11,"fingerCursor"], [12,"fingerCursor"], [13,"fingerCursor"], [14,"fingerCursor"], [15,"fingerCursor"], [16,"fingerCursor"], [17,"fingerCursor"], [18,"fingerCursor"]]
  81. end
  82.  
  83. -- -----------------------------------------------------------
  84. -- Handler goFromOverlayToTimePeriod 
  85.  
  86. on goFromOverlayToTimePeriod whichSprite
  87.   set timePeriod = the name of cast the castNum of sprite whichSprite
  88.   resetSpriteCursors
  89.   go timePeriod
  90. end
  91.  
  92. -- -----------------------------------------------------------
  93. -- Handler goTimeLineOverlay 
  94.  
  95. on goTimeLineOverlay
  96.   global TLButton
  97.   
  98.   puppetSprite TLButton, FALSE
  99.   go "Overlay"
  100.   resetSpriteCursors
  101. end
  102.  
  103. -- -----------------------------------------------------------
  104. -- Handler setUpTimePeriod 
  105.  
  106. on setUpTimePeriod
  107.   global currentTimePeriod, timeLineMenu
  108.   
  109.   setSpriteCursors [[currentTimePeriod,"fingerCursor"], [timeLineMenu,"fingerCursor"]]
  110.   
  111.   set V = the mouseV
  112.   set H = the mouseH
  113.   set bottomBorder = the bottom of sprite currentTimePeriod
  114.   set leftBorder = the left of sprite currentTimePeriod
  115.   set rightBorder = the right of sprite currentTimePeriod
  116.   
  117.   if (rollover(currentTimePeriod) or rollover(timeLineMenu)) or ((V > bottomBorder) and (V < bottomBorder + 15) and (H > leftBorder) and (H < rightBorder)) then
  118.     showTimePeriods
  119.   else
  120.     hideTimePeriods
  121.   end if
  122. end
  123.  
  124. -- -----------------------------------------------------------
  125. -- Handler animateTimeLineButton 
  126.  
  127. on animateTimeLineButton
  128.   global TLbutton, numTLButtons
  129.   
  130.   puppetSprite TLButton,TRUE
  131.   set newButtonIndex = value(word 2 of the name of cast the castNum of sprite TLbutton) + 1
  132.   if (newButtonIndex > numTLButtons) then set newButtonIndex = 1
  133.   set the castNum of sprite TLbutton = the number of cast ("time" && newButtonIndex)
  134. end